//
//  UILabel+LZExtension.m
//  百思不得姐
//
//  Created by 郝庆 on 16/5/26.
//  Copyright © 2016年 haoqing. All rights reserved.
//

#import "UILabel+LZExtension.h"

@implementation UILabel (LZExtension)
- (void)lz_setLineSpacing:(CGFloat)spacing
{
    NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:self.text];
    NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle setLineSpacing:spacing];
    [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [self.text length])];
    [self setAttributedText:attributedString];
    [self sizeToFit];
}

@end
